<template>
	<view>
		<swiper class="myswiper" autoplay="true" interval="5000" duration="500">
			<swiper-item class="myswiper-item" v-for="(item,index) in myBannerList" :key="index">
				<image :src="item.icon" class="swiper-item-img"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	//import BannerList from "@/common/data/banners.data.js"

	export default {
		name: "banner",
		data() {
			return {
				myBannerList: []
			};
		},
		mounted() {
			// 远程获取广告列表
			uni.request({
				url: getApp().globalData.baseUrl + '/banner/getlist',
				success: (result) => {

					if (result.data.statusCode == 200) {
						this.myBannerList = result.data.mydata
					}
					console.log(this.myBannerList)
				}
			})
		}
	}
</script>

<style lang="scss">
	.myswiper {
		width: 100%;
		height: 45vh;

		.myswiper-item {
			display: block;
			width: 100%;
			height: 100%;

			.swiper-item-img {
				width: 100%;
				height: 100%;
			}
		}
	}
</style>
